package cn.iocoder.yudao.module.wine.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.wine.api.dto.GuaranteeRecordDTO;
import cn.iocoder.yudao.module.wine.api.dto.TeamTypeDTO;
import cn.iocoder.yudao.module.wine.dal.dataobject.guaranteerecord.GuaranteeRecordDO;
import cn.iocoder.yudao.module.wine.dal.dataobject.teamtype.TeamTypeDO;
import cn.iocoder.yudao.module.wine.service.guaranteerecord.GuaranteeRecordService;
import cn.iocoder.yudao.module.wine.service.teamtype.TeamTypeService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

/**
 * @author zyc
 * @createDate 2024/7/29 11:52
 */
@Service
@Validated
public class TeamTypeApiImpl implements TeamTypeApi{

    @Resource
    private TeamTypeService teamTypeService;

    @Resource
    private GuaranteeRecordService guaranteeRecordService;
    @Override
    public TeamTypeDTO getTeamTypeInfo(Long teamTypeId) {
        TeamTypeDO teamType = teamTypeService.getTeamType(teamTypeId);
        return BeanUtils.toBean(teamType,TeamTypeDTO.class);
    }

    @Override
    public GuaranteeRecordDTO getGuaranteeRecordByNo(String no) {
        GuaranteeRecordDO guaranteeRecordDO = guaranteeRecordService.selectGuaranteeByNo(no);
        return BeanUtils.toBean(guaranteeRecordDO, GuaranteeRecordDTO.class);
    }
}
